<?php
require 'collection.php';

class ContentBox extends Collection 
{
	function GET()
	{
		if(isset($_GET['q']))
		{
			
			/* get limit and offset */

			if(isset($_GET['limit'])) $this->limit = $_GET['limit'];
			if(isset($_GET['offset'])) $this->offset = $_GET['offset'];			
			$rdf_xml = $this->store->contentbox->search($_GET['q'], $this->limit, $this->offset)->body;

			$Resources = $this->Convert->RDFXML->to_resources($rdf_xml);
			$resources = $Resources->find_by_rdftype($this->namespaces['rss'].'item');
			$this->variables = array_merge($this->variables, compact('rdf_xml','resources'));

		}
		return $this->show();
	}
}

?>